<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php switch ($element->getType()) {
    case 'fieldset': ?>

    <fieldset>
        <legend><?php /* @escapeNotVerified */ echo $element->getLegend() ?></legend><br />
        <?php foreach ($element->getElements() as $_element): ?>
            <?php /* @escapeNotVerified */ echo $formBlock->drawElement($_element) ?>
        <?php endforeach; ?>
    </fieldset>
      <?php break;
    case 'column': ?>
      <?php break;
    case 'hidden': ?>
    <input type="<?php /* @escapeNotVerified */ echo $element->getType() ?>" name="<?php /* @escapeNotVerified */ echo $element->getName() ?>" id="<?php echo $element->getHtmlId() ?>" value="<?php /* @escapeNotVerified */ echo $element->getValue() ?>">
      <?php break;
    case 'select': ?>
    <span class="form_row">
        <?php if ($element->getLabel()): ?><label for="<?php echo $element->getHtmlId() ?>"><?php /* @escapeNotVerified */ echo $element->getLabel() ?>:</label><?php endif; ?>
        <select name="<?php /* @escapeNotVerified */ echo $element->getName() ?>" id="<?php echo $element->getHtmlId() ?>" class="select<?php /* @escapeNotVerified */ echo $element->getClass() ?>" title="<?php /* @escapeNotVerified */ echo $element->getTitle() ?>">
        <?php foreach ($element->getValues() as $_value): ?>
            <option <?php /* @escapeNotVerified */ echo $_value->serialize() ?><?php if ($_value->getValue() == $element->getValue()): ?> selected="selected"<?php endif; ?>><?php /* @escapeNotVerified */ echo $_value->getLabel() ?></option>
        <?php endforeach; ?>
        </select>
    </span>
      <?php break;
    case 'text':
    case 'button':
    case 'password': ?>
    <span class="form_row">
        <?php if ($element->getLabel()): ?><label for="<?php echo $element->getHtmlId() ?>" <?php /* @escapeNotVerified */ echo $block->getUiId('label') ?>><?php /* @escapeNotVerified */ echo $element->getLabel() ?>:</label><?php endif; ?>
        <input type="<?php /* @escapeNotVerified */ echo $element->getType() ?>" name="<?php /* @escapeNotVerified */ echo $element->getName() ?>" id="<?php echo $element->getHtmlId() ?>" value="<?php /* @escapeNotVerified */ echo $element->getValue() ?>" class="input-text <?php /* @escapeNotVerified */ echo $element->getClass() ?>" title="<?php /* @escapeNotVerified */ echo $element->getTitle() ?>" <?php echo($element->getOnClick() ? 'onClick="' . $element->getOnClick() . '"' : '') ?>/>
    </span>
      <?php break;
    case 'radio': ?>
    <span class="form_row">
        <?php if ($element->getLabel()): ?><label for="<?php echo $element->getHtmlId() ?>"><?php /* @escapeNotVerified */ echo $element->getLabel() ?>:</label><?php endif; ?>
        <input type="<?php /* @escapeNotVerified */ echo $element->getType() ?>" name="<?php /* @escapeNotVerified */ echo $element->getName() ?>" id="<?php echo $element->getHtmlId() ?>" value="<?php /* @escapeNotVerified */ echo $element->getValue() ?>" class="input-text <?php /* @escapeNotVerified */ echo $element->getClass() ?>" title="<?php /* @escapeNotVerified */ echo $element->getTitle() ?>"/>
    </span>
      <?php break;
    case 'hidden': ?>
        <input type="<?php /* @escapeNotVerified */ echo $element->getType() ?>" name="<?php /* @escapeNotVerified */ echo $element->getName() ?>" id="<?php echo $element->getHtmlId() ?>" value="<?php /* @escapeNotVerified */ echo $element->getValue() ?>">
      <?php break;
    case 'radios': ?>
    <span class="form_row">
        <label for="<?php echo $element->getHtmlId() ?>"><?php /* @escapeNotVerified */ echo $element->getLabel() ?>:</label>
    <?php foreach ($element->getRadios() as $_radio): ?>
    <input type="radio" name="<?php /* @escapeNotVerified */ echo $_radio->getName() ?>" id="<?php echo $_radio->getHtmlId() ?>" value="<?php /* @escapeNotVerified */ echo $_radio->getValue() ?>" class="input-radio <?php /* @escapeNotVerified */ echo $_radio->getClass() ?>" title="<?php /* @escapeNotVerified */ echo $_radio->getTitle() ?>" <?php echo($_radio->getValue() == $element->getChecked()) ? 'checked="true"' : '' ?> >&nbsp;<?php /* @escapeNotVerified */ echo $_radio->getLabel() ?>
    <?php endforeach; ?>
    </span>
      <?php break;
    case 'wysiwyg': ?>
    <span class="form_row">
      <label for="<?php echo $element->getHtmlId() ?>"><?php /* @escapeNotVerified */ echo $element->getLabel() ?>:</label>
        <script>
        require([
            'tinymce'
        ], function(tinyMCE){
            tinyMCE.init({
                mode : "exact",
                theme : "advanced",
                elements : "<?php /* @escapeNotVerified */ echo $element->getName(); ?>",
                plugins : "inlinepopups,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
                theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
                theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,|,visualchars,nonbreaking",
                theme_advanced_toolbar_location : "top",
                theme_advanced_toolbar_align : "left",
                theme_advanced_path_location : "bottom",
                extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
                theme_advanced_resize_horizontal : 'false',
                theme_advanced_resizing : 'true',
                apply_source_formatting : 'true',
                convert_urls : 'false',
                force_br_newlines : 'true',
                doctype : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
            });
        });
</script>
      <textarea name="<?php /* @escapeNotVerified */ echo $element->getName() ?>" title="<?php /* @escapeNotVerified */ echo $element->getTitle() ?>" id="<?php echo $element->getHtmlId() ?>" class="textarea <?php /* @escapeNotVerified */ echo $element->getClass() ?>" cols="80" rows="20"><?php /* @escapeNotVerified */ echo $element->getValue(); ?></textarea>
    </span>
      <?php break;
        case 'textarea': ?>
            <span class="form_row">
                    <label for="<?php echo $element->getHtmlId() ?>"><?php /* @escapeNotVerified */ echo $element->getLabel() ?>:</label>
                    <textarea name="<?php /* @escapeNotVerified */ echo $element->getName() ?>" title="<?php /* @escapeNotVerified */ echo $element->getTitle() ?>" id="<?php echo $element->getHtmlId() ?>" class="textarea <?php /* @escapeNotVerified */ echo $element->getClass() ?>" cols="15" rows="2"><?php /* @escapeNotVerified */ echo $element->getValue(); ?></textarea>
            </span>
      <?php break;
    case 'editor': ?>
      <?php break;
    case 'file': ?>
      <?php break;
    case 'checkbox': ?>
      <?php break;
} ?>
<?php if ($element->getScript()): ?>
<script>
    <?php /* @escapeNotVerified */ echo $element->getScript() ?>
</script>
<?php endif; ?>
